# coding:utf-8

from flask import Flask, request
import json

app = Flask(__name__)

@app.route('/', methods=['POST'])
def print_result():
	url = request.form['url']
	data = request.form['response']

	data_dict = json.loads(data)
	data_result = data_dict['result']

	print url
	for item in data_result:
		print item['tid'] + '\t' + item['title']
	print '-' * 40
	return 'ok'

if __name__ == '__main__':
	app.run(host='0.0.0.0')